package com.zf.shuashua.ui.mine;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseViewHolder;
import com.meis.base.mei.adapter.MeiBaseAdapter;
import com.zf.shuashua.R;
import com.zf.shuashua.bean.BlackList;

import java.util.List;

public class BlackListAdapter extends MeiBaseAdapter<BlackList.DataBean> {

    public BlackListAdapter(int layoutResId, @Nullable List<BlackList.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BlackList.DataBean item) {
        if (item.getBlack() != null) {
            helper.setText(R.id.tvName, item.getBlack().getName())
                    .setText(R.id.tvIsFocus, "取消黑名单")
                    .setText(R.id.tvSign, item.getBlack().getSignature())
                    .addOnClickListener(R.id.tvIsFocus);

            Glide.with(mContext)
                    .load(item.getBlack().getAvatar() + "")
                    .circleCrop()
                    .into((ImageView) helper.getView(R.id.imgAvatar));

        }

    }
}